<cfsetting enablecfoutputonly="Yes">

<!--- 
  /**
   * @author  <info@mireau.net>
   * @version 1.0 - <yyyy/mm/dd>
   */
--->

<cfinclude template="#request.site.s_CFROOT#/lib/udf/fuselocation.cfm">

<cfscript>
  local.sFuseLocationDir  = request.udf.getFuseLocationDir();
  local.sRecycleUrl       = request.udf.getFuseLocation();
</cfscript>

<cfsetting enablecfoutputonly="No">

<br /><br /><br /><br /><br />
<cfmodule template="#request.site.s_CFROOT#/lib/customtags/border.cfm" nBorderWidth="90%">
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <cfif request.dev.b_INCLUDE_SYSTEMBAR>
      <cfmodule 
        template="#request.site.s_CFROOT#/lib/customtags/dirtree.cfm"
        sReturnVar="local.aDirTree"
      >

      <cfhtmlhead text="    
    <script type=""text/javascript"" src=""http://scripts.e-linewebsolutions.nl/scr_validate.js""></script>
    <script type=""text/javascript"" src=""#request.site.s_WEBROOT#/-http/-scripts/scr_system.js""></script>
  "
      >

      <form 
        action="<cfoutput>#request.site.s_WEBROOT#</cfoutput>/system/index.cfm" 
        method="post" 
        name="system" 
        id="system"
      >
        <input type="hidden" name="sysfuse"  value="addfuse">
        <input type="hidden" name="sDir"     value="">
        <input type="hidden" name="sNewFuse" value="">

        <tr>

          <!--- This section is for the directory management --->
          <td>
            <select name="sGuiDir">
              <cfloop from="1" to="#arrayLen( local.aDirTree )#" index="i">
                <option 
                  value="<cfoutput>#local.aDirTree[i]#</cfoutput>"
                  <cfif local.aDirTree[i] eq local.sFuseLocationDir>selected</cfif>
                ><cfoutput>#local.aDirTree[i]#</cfoutput></option>
              </cfloop>
            </select>
          </td>
          <td style="padding-right: 3px;" nowrap>
            <a
              href="JavaScript:self.location='<cfoutput>#request.site.s_WEBROOT#</cfoutput>/' + document.system.sGuiDir.value;"
              onMouseover="window.status=''; return( true );"
              onMouseout="window.status=''; return( true );"
              onClick="if( document.all ) { this.blur(); } return( true );"
            >goto</a>
            |
            <a
              href="JavaScript:newSysDir();"
              onMouseover="window.status=''; return( true );"
              onMouseout="window.status=''; return( true );"
              onClick="if( document.all ) { this.blur(); } return( true );"
            >new</a>
          </td>
          <td bgcolor="#cc0000"><cfoutput>#request.udf.spaceMe( 2, 1 )#</cfoutput></td>
          
          <!--- This is about the different fusetypes --->
          <cfset local.bShadedBG = true>
          <cfloop from="1" to="#arrayLen( request.fusebox.xFuseaction )#" index="i">
            <td 
              style="{ border-left  : 1px solid #cccccc; 
                       background   : #<cfif local.bShadedBG>f0f0f0<cfelse>ffffff</cfif>;
                     }"
            >
              <input 
                type="checkbox" 
                class="checkbox" 
                name="sType" 
                id="sType<cfoutput>#i#</cfoutput>"
                value="<cfoutput>#request.fusebox.xFuseaction[i][1]#</cfoutput>"
                onClick="if( document.all ) { this.blur(); }"
              >
            </td>
            <td 
              style="{ background     : #<cfif local.bShadedBG>f0f0f0<cfelse>ffffff</cfif>;
                       padding-right  : 3px;
                     }"
            >
              <label for="sType<cfoutput>#i#</cfoutput>"><cfoutput>#request.fusebox.xFuseaction[i][1]#</cfoutput></label>
            </td>
            <cfset local.bShadedBG = not local.bShadedBG>
          </cfloop>

          <td 
            style="{ border-left    : 1px solid #cccccc; 
                     border-right   : 1px solid #cccccc;
                     background     : #<cfif local.bShadedBG>f0f0f0<cfelse>ffffff</cfif>;
                     padding-left   : 3px;
                     padding-right  : 3px;
                   }"
          >
            <a
              href="JavaScript:newSysFuse();"
              onMouseover="window.status=''; return( true );"
              onMouseout="window.status=''; return( true );"
              onClick="if( document.all ) { this.blur(); } return( true );"
            >new</a>
          </td>
        </tr>

        <cfif request.dev.b_DBUG>
          <tr><td colspan="<cfoutput>#int(( arrayLen( request.fusebox.xFuseaction ) * 2 ) + 4 )#</cfoutput>"><hr/></td></tr>
        </cfif>
      </form>
    </cfif>

    <cfif request.dev.b_DBUG>
      <cfscript>
        if( local.sRecycleUrl eq "." )
        {
          if( len( request.site.s_WEBROOT ))
          {
            local.sRecycleUrl = "";
          }
          else
          {
            local.sRecycleUrl = "/";
          }
        }
        
        /*
         * Make sure we have the current fuseaction. We could be missing this
         * fuseaction if we came from a formpost, and the fuseaction variable
         * is in the form post http header.
         */
        if( not findNoCase( "fuseaction", local.sRecycleUrl ))
        {
          if( listLen( local.sRecycleUrl, "?" ) gt 1 )
          {
            local.sRecycleUrl = local.sRecycleUrl & "&fuseaction=" & attributes.fuseaction;
          }
          else if( listLen( local.sRecycleUrl, "&" ) gt 1 )
          {
            local.sRecycleUrl = local.sRecycleUrl & "?fuseaction=" & attributes.fuseaction;
          }
          else
          {
            local.sRecycleUrl = local.sRecycleUrl & "/?fuseaction=" & attributes.fuseaction;
          }
        }

        /*
         * Append the recycle attribute to the local page Url.
         */
        if( not findNoCase( "bRecycle", local.sRecycleUrl ))
        {
          if( listLen( local.sRecycleUrl, "?" ) gt 1 )
          {
            local.sRecycleUrl = local.sRecycleUrl & "&bRecycle=1";
          }
          else if( listLen( local.sRecycleUrl, "&" ) gt 1 )
          {
            local.sRecycleUrl = local.sRecycleUrl & "?bRecycle=1";
          }
          else
          {
            local.sRecycleUrl = local.sRecycleUrl & "/?bRecycle=1";
          }
        }
      </cfscript>
      
      <tr>
        <td colspan="<cfoutput>#int(( arrayLen( request.fusebox.xFuseaction ) * 2 ) + 4 )#</cfoutput>">
          <a
            href="<cfoutput>#request.site.s_WEBROOT#/#local.sRecycleUrl#</cfoutput>"
            onMouseover="window.status=''; return( true );"
            onMouseout="window.status=''; return( true );"
            onClick="if( document.all ) { this.blur(); } return( true );"
          >recycle</a>
        </td>
      </tr>
    </cfif>
  </table>
</cfmodule>